-- GENERATED SPELL FOR [Gordunni Soulreaper] --


function spell0_23022(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(20743,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_23022', 5000, 1)
end

function spell1_23022(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(15232,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23022', 3000, 1)
end

function spell2_23022(pUnit, Event) --@Summon Skeleton,Self--
pUnit:FullCastSpellOnTarget(20464,pUnit)
pUnit:RegisterEvent('Sorts_23022', 540, 1)
end

function Sorts_23022(pUnit, Event)
local choix_sorts_23022 = math.random(0, 2)
if choix_sorts_23022 == 0 then
pUnit:RegisterEvent('spell0_23022', 1, 1)
end
if choix_sorts_23022 == 1 then
pUnit:RegisterEvent('spell1_23022', 1, 1)
end
if choix_sorts_23022 == 2 then
pUnit:RegisterEvent('spell2_23022', 1, 1)
end
end

function mob23022_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23022', math.random(1500, 3000), 1)
end

function mob23022_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23022_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23022_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23022, 1, 'mob23022_Action')
RegisterUnitEvent(23022, 2, 'mob23022_Leave')
RegisterUnitEvent(23022, 3, 'mob23022_Kill')
RegisterUnitEvent(23022, 4, 'mob23022_Die')
